<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>考神驾到手机资讯页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="css/public.css">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/windowsheight.js"></script>

    <script src="${pageContext.request.contextPath}/manager_page/layui/layui.js"></script>

</head>

<body>

<input type="hidden"  id="info_class_hidden" value=${param.info_class_hidden} >

<!-----------头部开始--------------->
<%@ include file="page_head.jsp"%>
<!-----------头部结束--------------->
<!-----------内容开始--------------->
<div class="content">
    <div class="biaoshitop">&nbsp;</div>
    <div class="titlecom">
        <p class="video_p"><a href="jiaotong_biaoshi_detail.jsp">资讯</a></p>
        <div class="tabtila fr">
            <a href="javascript:changeInfo('新手学车','');">新手学车</a> | <a href="javascript:changeInfo('驾考常识','');">驾考常识</a> | <a href="javascript:changeInfo('交通法规','');">交通法规</a>
            <a  href="javascript:;" class="titlemore"><img src="images/title_69.jpg"/></a>
        </div>
        <div class="moresort" id="moresort_div_parent">
            <div class="moresost_con" id="moresort_div">
                <span><a href="javascript:changeInfo('','');">全部</a></span>
                <span><a href="javascript:changeInfo('新手学车','');">新手学车</a></span>
                <span><a href="javascript:changeInfo('驾考常识','');">驾考常识</a></span>
                <span><a href="javascript:changeInfo('驾考攻略','');">驾考攻略</a></span>
                <span><a href="javascript:changeInfo('交通法规','');">交通法规</a></span>
                <span><a href="javascript:changeInfo('','科一');">科一相关</a></span>
                <span><a href="javascript:changeInfo('','科四');">科四相关</a></span>
                <span><a href="javascript:changeInfo('','科二');">科二相关</a></span>
                <span><a href="javascript:changeInfo('','科三');">科三相关</a></span>
                <div class="clear"></div>
            </div>
        </div>
    </div>

    <ol class="newsin" id="info_title_ol">
<%--        <li><span>[2021.12.12]</span><a href="news_detail.jsp"><span>1.</span>温州2015</a></li>--%>
    </ol>

    <div class="pageturn">
        <div class="prepage"><a href="javascript:lastPage();">< 上一页</a></div>
        <p><span><b id="current_page">1</b>/<label id="total_page">0</label></span></p>
        <div class="prepage"> <a href="javascript:nextPage();">下一页 ></a></div>
    </div>
</div>
<!-----------内容结束--------------->
<%-- <div class="footer">--%>
<%--   <p>©考神驾到版权所有</p>--%>
<%--   <span>www.kaoshenjiadao.com</span>--%>
<%-- </div>--%>

</body>
<!--头部高度赋给列表的topjs-->


<script>
    $("#page_head_title").text("资讯");

    var layer;
    layui.use('layer',function(){
        layer=layui.layer;
    })

    var info_class_hidden=$("#info_class_hidden").val();
    var flag_title=true;
    var total_page;
    var current_page=1;
    var array_info;
    window.onload=function(){
        changeInfo(info_class_hidden,'');
    }

    function changeInfo(info_class,other_class){
        $.ajax({
            url:"${pageContext.request.contextPath}/front_info/info_change_index.do",
            data:{
                "info_class":info_class,
                "other_class":other_class
            },
            success:function(data,status){
                if(status=="success"){
                    total_page=Math.ceil(data.length/10);
                    current_page=1;
                    array_info=data;
                    changeOl(data,1);
                    $("#current_page").text(current_page);
                    $("#total_page").text(total_page);
                }
            }
        })

        $("#moresort_div_parent").attr("style","display: none;");
        $(".titlemore img").attr("src","images/title_69.jpg");
        flag_title=true;
    }
    function changeOl(data,page){
        $("#info_title_ol").empty();
        var index_start=(page-1)*10;
        var index_end=index_start+10;
        if(page==total_page){
            index_end=data.length;
        }
        if(total_page==0){
            index_end=0;
        }
        for(var i=index_start;i<index_end;i++){
            // <li><span>[2021.12.12]</span><a href="news_detail.jsp"><span>1.</span>温州2015</a></li>
            var li=$("<li></li>");
            var info_time=new Date(parseInt(data[i].info_time));
            // var time_str=info_time.getFullYear()+"-"+info_time.getMonth()+"-"+info_time.getDay();
            var time_str=info_time.toLocaleString().substring(0,10);
            time_str=time_str.replace('/','-');
            time_str=time_str.replace('/','-');
            var span1=$("<span></span>").text("["+time_str+"]");
            var a=$("<a></a>").attr("href","javascript:to_infodetail(+"+data[i].info_id+");");
            var num=i-index_start+1;
            var span2=$("<span></span>").text(num+".");
            var label=$("<label></label>").text(data[i].info_title);
            a.append(span2,label);
            li.append(span1,a);
            $("#info_title_ol").append(li);
        }
    }
    function to_infodetail(info_id){
        window.location.href="info_detail.jsp?info_id_hidden="+info_id;
    }


    function lastPage(){
        if(current_page<=1){
            layer.msg("这已经是第一页了");
        }else{
            current_page--;
            changeOl(array_info,current_page);
            $("#current_page").text(current_page);
        }
    }

    function nextPage(){
        if(current_page>=total_page){
            layer.msg("这已经是最后一页了");
        }else{
            current_page++;
            changeOl(array_info,current_page);
            $("#current_page").text(current_page);
        }
    }






    $(".titlemore").click(function (){
        if(flag_title){
            $("#moresort_div_parent").attr("style","display: block;");
            $(".titlemore img").attr("src","images/title_692.jpg");
            flag_title=false;
        }else{
            $("#moresort_div_parent").attr("style","display: none;");
            $(".titlemore img").attr("src","images/title_69.jpg");
            flag_title=true;
        }

    })
</script>









<script>
    var heighttop=$(".top").height();
    $(".topmenu").css("top",heighttop);
    $(".menumore").toggle(function(){
        $(".topmenu").show();
    },function(){
        $(".topmenu").hide();
    })
    $(".buttontop").click(function(){
        $(".topmenu").hide();
    })

    $(function(){
        $(".tasecartop span a").click(function(){
            var $banktip=$(this).attr("tip");
            $($banktip).show().siblings().hide();
            $(".tasecartop span a").removeClass("payaclik");
            $(this).addClass("payaclik");
        })

    })
</script>

<!--头部高度赋给列表的topjs-->
<!--banner将图片的高度赋给父级扪js-->
<script>
    var heighta=$("#incltialiu li:eq(0) img").height();
    $(".main,.width,#incltialiu").height(heighta) ;
</script>
<!--banner将图片的高度赋给父级扪js-->
<!--首页标题点击出现更多分类js-->
<script>
    // $(".titlemore").toggle(function(){
    // 	$(this).parent(".tabtila").siblings(".moresort").show()
    // 	$(this).children("img").attr("src","images/title_692.jpg")
    // 	},function(){
    // 	$(this).parent(".tabtila").siblings(".moresort").hide()
    // 	$(this).children("img").attr("src","images/title_69.jpg")
    // 	})

</script>
<!--首页标题点击出现更多分类js-->
</html>
